/**
 * Created by justao on 16/2/14.
 */
'use strict';

import React, {
    Component,
    Text,
    PixelRatio,
    StyleSheet,
    View,
    TouchableHighlight
} from 'react-native';

export default class MeItem extends Component {
  render () {
    if (this.props.onPress) {
      return (
          <TouchableHighlight
              style={styles.row}
              underlayColor="#D0D0D0"
              onPress={this.props.onPress}>
            <Text style={styles.buttonText}>
              {this.props.text}
            </Text>
          </TouchableHighlight>
      );
    }
    return (
        <View style={styles.row}>
          <Text style={styles.rowText}>
            {this.props.text}
          </Text>
        </View>
    );
  }
}

const styles = StyleSheet.create({
  row: {
    padding: 15,
    backgroundColor: 'white',
    borderBottomWidth: 1 / PixelRatio.get(),
    borderBottomColor: '#CDCDCD',
  },
  rowText: {
    fontSize: 17,
  },
  buttonText: {
    fontSize: 17,
    fontWeight: '500',
  }
});